package cn.com.thingo.hyintelligent.model.http;


import java.util.List;

import javax.inject.Inject;

import cn.com.thingo.hyintelligent.model.bean.BaseBean;
import cn.com.thingo.hyintelligent.model.bean.CommonBean;
import cn.com.thingo.hyintelligent.model.bean.EzAccountBean;
import cn.com.thingo.hyintelligent.model.bean.DoorLockAuthBean;
import cn.com.thingo.hyintelligent.model.bean.EzAddDevicePermissionBean;
import cn.com.thingo.hyintelligent.model.bean.EzDeleteDevicePermissionBean;
import cn.com.thingo.hyintelligent.model.bean.EzDeviceAuthorizationListBean;
import cn.com.thingo.hyintelligent.model.bean.EzDevicePolicyBean;
import cn.com.thingo.hyintelligent.model.bean.EzDeviceStateBean;
import cn.com.thingo.hyintelligent.model.bean.GatewayDetailBean;
import cn.com.thingo.hyintelligent.model.bean.GatewayListBean;
import cn.com.thingo.hyintelligent.model.bean.GetEzTokenBean;
import cn.com.thingo.hyintelligent.model.bean.LoginBean;
import cn.com.thingo.hyintelligent.model.bean.MessageCountBean;
import cn.com.thingo.hyintelligent.model.bean.MessageListBean;
import cn.com.thingo.hyintelligent.model.bean.ModifyHeadBean;
import cn.com.thingo.hyintelligent.model.bean.RegisterBean;
import cn.com.thingo.hyintelligent.model.bean.UserBean;
import cn.com.thingo.hyintelligent.model.http.api.ShouCheApis;
import io.reactivex.Flowable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;

/**
 * Created by Administrator on 2017/10/9.
 */

public class RetrofitHelper implements HttpHelper {

    private ShouCheApis mShouCheApiService;

    @Inject
    public RetrofitHelper(ShouCheApis shouCheApiService) {
        this.mShouCheApiService = shouCheApiService;
    }

    //获取手机验证码
    @Override
    public Flowable<CommonBean> getCode(String telephone) {
        return mShouCheApiService.getCode(telephone);
    }

    //注册
    @Override
    public Flowable<RegisterBean> register(String password, String telephone, String code) {
        return mShouCheApiService.register(password, telephone, code);
    }

    @Override
    public Flowable<LoginBean> login(String password, String telephone) {
        return mShouCheApiService.login(password, telephone);
    }

    @Override
    public Flowable<GatewayListBean> gatewayList(String token) {
        return mShouCheApiService.gatewayList(token);
    }

    @Override
    public Flowable<CommonBean> addGateway(String token, String number, String name, String username, String password) {
        return mShouCheApiService.addGateway(token, number, name, username, password);
    }

    @Override
    public Flowable<CommonBean> modifyGateway(String token, String gatewayId, String name) {
        return mShouCheApiService.modifyGateway(token, gatewayId, name);
    }

    @Override
    public Flowable<CommonBean> deleteGateway(String token, String gatewayId) {
        return mShouCheApiService.deleteGateway(token, gatewayId);
    }

    @Override
    public Flowable<GatewayDetailBean> gatewayDetail(String token, String gatewayId) {
        return mShouCheApiService.gatewayDetail(token, gatewayId);
    }

    @Override
    public Flowable<CommonBean> addAuth(String token, String gatewayId, String telephone) {
        return mShouCheApiService.addAuth(token, gatewayId, telephone);
    }

    @Override
    public Flowable<CommonBean> delAuth(String token, String gatewayId, String telephone) {
        return mShouCheApiService.delAuth(token, gatewayId, telephone);
    }

    @Override
    public Flowable<UserBean> getUser(String token) {
        return mShouCheApiService.getUser(token);
    }


    @Override
    public Flowable<ModifyHeadBean> modifyHead(RequestBody token, MultipartBody.Part headPic) {
        return mShouCheApiService.modifyHead(token, headPic);
    }

    @Override
    public Flowable<CommonBean> getCodeByModifyPassword(String telephone) {
        return mShouCheApiService.getCodeByModifyPassword(telephone);
    }

    @Override
    public Flowable<CommonBean> modifyPassword(String password, String telephone, String code) {
        return mShouCheApiService.modifyPassword(password, telephone, code);
    }


    @Override
    public Flowable<BaseBean> createEzAccount(String token, String accountName, String password, String accessToken) {
        return mShouCheApiService.createEzAccount(token, accountName, password, accessToken);
    }

    @Override
    public Flowable<EzDeviceStateBean> addEzDevice(String deviceSerial, String validateCode) {
        return mShouCheApiService.addEzDevice(deviceSerial, validateCode);
    }

    @Override
    public Flowable<EzDeviceStateBean> deleteEzDevice(String deviceSerial) {
        return mShouCheApiService.deleteEzDevice(deviceSerial);
    }

    @Override
    public Flowable<EzDevicePolicyBean> setEzDevicePolicy(String accountId, String policy) {
        return mShouCheApiService.setEzDevicePolicy(accountId, policy);
    }

    @Override
    public Flowable<BaseBean> addEzDevicePermission(String accessToken, String tel, String toTel, String statement) {
        return mShouCheApiService.addEzDevicePermission(accessToken, tel, toTel, statement);
    }

    @Override
    public Flowable<BaseBean> deleteEzDevicePermission(String accessToken, String tel, String toTel, String deviceSerial) {
        return mShouCheApiService.deleteEzDevicePermission(accessToken, tel, toTel, deviceSerial);
    }

    @Override
    public Flowable<BaseBean<List<EzDeviceAuthorizationListBean>>> getEzDeviceAuthorzationList(String accessToken, String tel, String toTel) {
        return mShouCheApiService.getEzDeviceAuthorzationList(accessToken,tel, toTel);
    }

    @Override
    public Flowable<BaseBean<String>> getAdminEzToken(String token, String secret, String appkey) {
        return mShouCheApiService.getAdminEzToken(token, secret, appkey);
    }

    @Override
    public Flowable<BaseBean<EzAccountBean>> getSonAccountMsg(String token, String accessToken) {
        return mShouCheApiService.getSonAccountMsg(token, accessToken);
    }

    @Override
    public Flowable<CommonBean> addDoorLockAuth(String token, String gatewayId, String telephone) {
        return mShouCheApiService.addDoorLockAuth(token, gatewayId, telephone);
    }

    @Override
    public Flowable<CommonBean> delDoorLockAuth(String token, String gatewayId, String telephone) {
        return mShouCheApiService.delDoorLockAuth(token, gatewayId, telephone);
    }

    @Override
    public Flowable<DoorLockAuthBean> doorLockAuthList(String token, String gatewayId) {
        return mShouCheApiService.doorLockAuthList(token, gatewayId);
    }

    @Override
    public Flowable<CommonBean> addMessage(String token, String title, String content) {
        return mShouCheApiService.addMessage(token, title, content);
    }

    @Override
    public Flowable<MessageListBean> messageList(String token) {
        return mShouCheApiService.messageList(token);
    }

    @Override
    public Flowable<MessageCountBean> messageCount(String token) {
        return mShouCheApiService.messageCount(token);
    }

    @Override
    public Flowable<CommonBean> readMessage(String token, String messageId) {
        return mShouCheApiService.readMessage(token, messageId);
    }

    @Override
    public Flowable<CommonBean> logout(String token) {
        return mShouCheApiService.logout(token);
    }


}
